namespace PDUConverter
{
    /// <summary>
    /// The base class for the message flags of outgoing messages.
    /// </summary>
    public abstract class OutgoingMessageFlags
    {
        protected OutgoingMessageFlags()
        {
        }

        /// <summary>
        /// In derived classes, converts the value of the specified <see cref="T:System.Byte" /> value into an <see cref="T:GsmComm.PduConverter.OutgoingMessageFlags" /> object.
        /// </summary>
        /// <param name="b">A <see cref="T:System.Byte" /> value.</param>
        protected abstract void FromByte(byte b);
        /// <summary>
        /// Converts the value of the specified instance into a byte.
        /// </summary>
        /// 
        /// <summary>
        /// Converts the value of the specified <see cref="T:GsmComm.PduConverter.OutgoingMessageFlags" /> instance into a <see cref="T:System.Byte" />.
        /// </summary>
        /// <param name="flags">A <see cref="T:GsmComm.PduConverter.OutgoingMessageFlags" /> object.</param>
        /// <returns>A new <see cref="T:System.Byte" /> value representing the object's value.</returns>
        public static implicit operator byte(OutgoingMessageFlags flags)
        {
            return flags.ToByte();
        }

        /// <summary>
        /// In derived classes, returns the byte equivalent of this instance.
        /// </summary>
        /// <returns>The byte value.</returns>
        public abstract byte ToByte();
        /// <summary>
        /// Returns the string equivalent of this instance.
        /// </summary>
        /// <returns>The string.</returns>
        public override string ToString()
        {
            return this.ToByte().ToString();
        }

        /// <summary>
        /// Gets the message type.
        /// </summary>
        public abstract OutgoingMessageType MessageType { get; }
    }
}